///////////////////////////////////////////////////////////////////////////
//  Brainfreeze - Yet another sokoban puzzle game, this time in 3D
//  Copyright (C) 2006 Scott MacDonald
//
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License along
//  with this program; if not, write to the Free Software Foundation, Inc.,
//  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
///////////////////////////////////////////////////////////////////////////
// MovableObject.h - Definition for an object ("entity") that can be moved 
// around the level.
#pragma once
//#ifndef __BF_MOVABLE_OBJECT_H__
//#define __BF_MOVABLE_OBJECT_H__
#include "stdafx.h"

extern class GameLevel;						// I *really* hate you C++

class MovableObject
{
public:
	MovableObject(Ogre::Vector3 pos);
	MovableObject();
	~MovableObject(void);

	/*
	 * Sets the object at the specified position. Gamelevel
	 * is sent so we can be sure that the position is valid
	 */
	void SetPos(Ogre::Vector3 pos, GameLevel& level);

	Ogre::Vector3 GetPos()
	{
		return position;
	}

	/*
	 * Methods to move the object up/down/left/right. It will return
	 * false if the move fails. If the extra parameter FORCE is set to
	 * true, than the move will happen regardless of if it is blocked
	 */
	virtual bool MoveLeft(GameLevel& level, bool force);
	virtual bool MoveRight(GameLevel& level, bool force);
	virtual bool MoveUp(GameLevel& level, bool force);
	virtual bool MoveDown(GameLevel& level, bool force);

	/*
	 * Methods to test if the object is blocked from moving up/down/left/right
	 */
	bool CanMoveLeft(GameLevel& level);
	bool CanMoveRight(GameLevel& level);
	bool CanMoveUp(GameLevel& level);
	bool CanMoveDown(GameLevel &level);

protected:
	/*
	 * Checks if the specified position is actually blocked by another object
	 */
	bool IsBlocked(GameLevel& level, Ogre::Vector3 pos);

	Ogre::Vector3		position;
};

//#endif